package com.project.springboot.reflect.entity;

import java.util.Objects;

/**
 * description: 工人
 * @author 朱正磊
 * @date 2024-08-14 13:54:07
 */
public class Worker {

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    public Worker() {

    }

    public Worker(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Worker{name='" + name + "', age=" + age + "}";
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Worker worker = (Worker) o;
        return Objects.equals(name, worker.name) && Objects.equals(age, worker.age);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age);
    }

}
